﻿using GylCSharpUtils.Common.Base.SpecialConverter;
using GylCSharpUtils.Common.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GylCSharpUtils.GSerializer.Template {
    public class GSTCacheInfo {
        public Type type { get; private set; }
        public string fullName { get; private set; }
        public ulong GSTID { get; private set; }
        public GSTemplate template { get; private set; }
        public ASpecialConverter converter { get; protected internal set; }

        public GSTCacheInfo() { }
        public GSTCacheInfo(Type type, string fullName, ulong gSTID, GSTemplate template, ASpecialConverter converter = null) {
            this.type = type;
            this.fullName = fullName;
            GSTID = gSTID;
            this.template = template;
            if(converter != null) {
                this.converter = converter;
            }
        }

        public override bool Equals(object obj) {
            return obj is GSTCacheInfo info &&
                   fullName.Equals(info.fullName);
        }

        public override int GetHashCode() {
            return 893528495 + fullName.GetHashCode();
        }
    }
}
